import random
import string

max_length = 8      # 激活码最大长度
mark_set = set()
while len(mark_set)<200:
    length = random.randint(6, max_length)
    elem = ''.join((i for i in random.choices(string.ascii_letters+string.digits,k=length)))
    mark_set.add(elem)

print(mark_set)


# 结果是对的，尝试改成函数，将优惠券长度改成函数参数。试着实现一下。

